#include <iostream>
#include "Consumer.h"
#include "Producer.h"
#include "TaskQueue.h"

void test(){
    Consumer con;
    Producer por;
    TaskQueue taskQue(10);

    thread proTh(&Producer::Produce,&por,std::ref(taskQue));
    thread conTh(&Consumer::consume,&con,std::ref(taskQue));
    
    //主线程等待生产者和消费者线程
    proTh.join();
    conTh.join();
}
int main()
{
    test();
    return 0;
}

